package Lee_code;

public class Lee_9999 {
    public static void main(String[] args) {
        String str = "000011111110010101001";
        int len = str.length();
        char[] ch = str.toCharArray();
        int max = 0;
        int temp_max=0;
        StringBuilder sb = new StringBuilder();
        for(char i: ch)
        {
            if(i=='1')
            {
                temp_max++;
            }
            else
            {
                max = Math.max(temp_max, max);
                temp_max=0;
            }
        }
        System.out.println(max);
    }
}
